package com.tjetc.mapper;

import com.tjetc.domain.CustomerMessage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface MessageMapper {

    CustomerMessage selectById(int cid);

    @Insert("insert into customer_message (customer_id, name, phone, driving_license) values (#{customer_id},#{name},#{phone},#{dirving_license});")
    int insert(CustomerMessage customerMessage);

    @Update("update customer_message set phone = #{phone},driving_license=#{dirving_license} where customer_id=#{customer_id} ;")
    int update(CustomerMessage customerMessage);


    CustomerMessage getMessageByCustomerId(Integer customerId);

    @Select("select * from customer_message where driving_license=#{drivingLicense}")
    CustomerMessage getMessageByDriving(String drivingLicense);

    @Select("select * from customer_message where phone=#{phone};")
    CustomerMessage getMessageByPhone(String phone);
}
